﻿using System;
using System.IO;

namespace CueMounter.DokanStructure {
	public abstract class DokanFile : IBinaryProvider {
		public string Name { get; set; }

		public abstract long Length { get; set; }

		public virtual bool CanRead
		{
			get
			{
				return false;
			}
		}

		public virtual long Read(long fileOffset, byte[] buffer, long bufferOffset, long length)
		{
			throw new NotSupportedException();
		}

		public virtual bool CanWrite
		{
			get
			{
				return false;
			}
		}

		public virtual FileAttributes Attributes
		{
			get
			{
				return FileAttributes.Normal;
			}
		}

		public virtual DokanFileDates Dates
		{
			get
			{
				DateTime now = DateTime.Now;
				DateTime before = DateTime.Now.Subtract(TimeSpan.FromHours(1));
				return new DokanFileDates(before, now, now);
			}
			set
			{
			}
		}

		public virtual long Write(long fileOffset, byte[] buffer, long bufferOffset, long length)
		{
			throw new NotSupportedException();
		}

		public virtual void Dispose()
		{
		}
	}
}
